package com.example.service.implService;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.dao.TeacherInfoDao;
import com.example.mapper.TeacherMapper;
import com.example.pojo.TeacherInfo;
import com.example.service.TeacherInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TeacherInfoServiceImpl implements TeacherInfoService {
    @Resource
    private TeacherInfoDao teacherInfoDao;
    @Resource
    private TeacherMapper teacherMapper;
    @Override
    public List<TeacherInfo> teacherInfoList() {
        return teacherInfoDao.teacherInfoList();
    }

    @Override
    public IPage<TeacherInfo> teacherInfoListPage(int currentPage, int limit) {
        return teacherInfoDao.teacherInfoListPage(currentPage,limit);
    }

    @Override
    public IPage<TeacherInfo> getTeacherByName(int currentPage, int limit, String teacherName) {
        return teacherInfoDao.getTeacherByName(currentPage,limit,teacherName);
    }

    @Override
    public TeacherInfo getTeacherByName(String teacherName) {
        return teacherInfoDao.getTeacherByName(teacherName);
    }

    @Override
    public int addTeacher(TeacherInfo teacherInfo) {
        return teacherInfoDao.addTeacher(teacherInfo);
    }

    @Override
    public int updateTeacher(TeacherInfo teacherInfo) {
        return teacherMapper.updateById(teacherInfo);
    }

    @Override
    public int batchDeleteTeacherInfo(List<Long> ids) {
        return teacherMapper.deleteBatchIds(ids);
    }

    @Override
    public int deleteTeacherInfo(Long eid) {
        return teacherInfoDao.deleteTeacherInfo(eid);
    }
}
